﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace OurWedding1.Models
{
    [MetadataType(typeof(ExpenseBuddy))]
    public partial class Expense
    {
        [DataType(DataType.Currency)]
        [Display(ResourceType = typeof (Resources), Name = "Expense_TotalAmount")]
        public decimal TotalAmount { get; set; }

        [DataType(DataType.Currency)]
        [Display(ResourceType = typeof (Resources), Name = "Expense_TotalPlanAmount")]
        public decimal TotalPlanAmount { get; set; }

        [DataType(DataType.Currency)]
        [Display(ResourceType = typeof (Resources), Name = "Expense_Paided")]
        public decimal Paided { get; set; }

        [DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:P0}")]
        [Display(ResourceType = typeof (Resources), Name = "Expense_Progress")]
        public double Progress
        {
            get;
            set;
        }

        [DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:P0}")]
        [Display(ResourceType = typeof (Resources), Name = "Expense_Difference")]
        public double Difference
        {
            get;
            set;
        }
    }

    public class ExpenseBuddy
    {
        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_Name_Required")]
        [Display(Name = "Expense_Name", ResourceType = typeof(Resources))]
        public string Name { get; set; }

        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_ActualAmount_Required")]
        [Display(ResourceType = typeof (Resources), Name = "ExpenseBuddy_ActualAmount")]
        [DataType(DataType.Currency)]
        public decimal ActualAmount { get; set; }

        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_WeddingId_Required")]
        [Display(ResourceType = typeof (Resources), Name = "Expense_WeddingId")]
        public int WeddingId { get; set; }

        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_isNotIncluded_Required")]
        [Display(Name = "Expense_isNotIncluded", ResourceType = typeof(Resources))]
// ReSharper disable InconsistentNaming
        public bool isNotIncluded { get; set; }
// ReSharper restore InconsistentNaming

        [Display(ResourceType = typeof (Resources), Name = "Expense_ContractorId")]
        public int? ContractorId { get; set; }

        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_ExpenseCategoryId_Required")]
        [Display(ResourceType = typeof (Resources), Name = "Expense_ExpenseCategoryId")]
        public int ExpenseCategoryId { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_ContractorId")]
        public virtual Contractor Contractor { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_ExpenseCategoryId")]
        public virtual ExpenseCategory ExpenseCategory { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_Tasks")]
        public virtual ICollection<Task> Tasks { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_WeddingId")]
        public virtual Wedding Wedding { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_Installments")]
        public virtual ICollection<Installment> Installments { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_GuestInExpenses")]
        public virtual ICollection<GuestInExpense> GuestInExpenses { get; set; }

        [Display(ResourceType = typeof (Resources), Name = "Expense_ExpenseTypeId")]
        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "Expense_ExpenseTypeId")]
        public int ExpenseTypeId { get; set; }


// ReSharper disable InconsistentNaming
        [Display(ResourceType = typeof (Resources), Name = "Expense_isFullyPaid")]
        [Required(ErrorMessageResourceType = typeof (Resources), ErrorMessageResourceName = "ExpenseBuddy_isFullyPaid_Required")]
        public bool isFullyPaid { get; set; }
// ReSharper restore InconsistentNaming

    }
}